<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<style type="text/css">
.ui-layout-north {
	z-index: 20 !important;
	overflow: visible !important;;
}

.ui-layout-north .ui-layout-unit-content {
	overflow: visible !important;
}

.ui-widget {
	font-size: 9px !important;
}

.size {
	width: 800px;
	position: relative;
	left: 17%;
	top: 10%;
}

.centro {
	top: 50%
}

.tabela {
	width: 730px;
}
</style>

	<title>Diplomas</title>
</h:head>

<h:body>
	<ui:decorate template="/templateBase.xhtml">
		<ui:define name="center">
			<p:growl life="3000" id="growl" />
			<h:form id="formDiploma" acceptcharset="ISO-8859-1" lang="pt">
				<br />
				<br />
				<br />

				<p:panel header="Cadastro de Diploma" styleClass="size"
					footer="SAIES - Sistema de Avaliação Institucional do Ensino Superior">
					<br />
					<p:tabView>
						<p:tab title="Dados do Aluno">

							<h:panelGrid columns="3">
								<h:outputText value="CPF ....: " />
								<p:inputMask mask="999.999.999-99" size="20"
									value="#{diplomaBacking.cpfInformado}">
									<p:ajax listener="#{diplomaBacking.buscarAluno}" event="blur"
										process="@this" update="txtNome,txtEmail" />
								</p:inputMask>
								<p:commandButton icon="ui-icon-search"
									oncomplete="dlgPesquisaDepto.show()" />
							</h:panelGrid>

							<h:panelGrid columns="4" cellspacing="5">
								<h:outputText value="Nome" />
								<p:inputText size="50" maxlength="50"
									value="#{diplomaBacking.alunoSalvar.nome}" id="txtNome" />
								<h:outputText value="E-mail" />
								<p:inputText size="40" id="txtEmail"
									value="#{diplomaBacking.alunoSalvar.email}" />
								<h:outputText value="Curso:" />
								<p:selectOneMenu value="#{diplomaBacking.codCursoSelecionado}">
									<f:selectItem itemLabel="Selecione" itemDisabled="true" />
									<f:selectItems value="#{diplomaBacking.listaCurso}" var="c"
										itemLabel="#{c.nome}" itemValue="#{c.idOrion}" />
									<p:ajax listener="#{diplomaBacking.buscaDadosDiploma}"
										update="v1" />
								</p:selectOneMenu>
							</h:panelGrid>
							<br />
							<p:separator />

							<p:tabView id="v1">
								<p:tab title="Situação" id="tab1">
									<h:panelGrid columns="3">
										<p:calendar value="#{diplomaBacking.dsSalvar.data}" />
										<p:selectOneMenu
											value="#{diplomaBacking.codSituacaoSelecionada}">
											<f:selectItem itemLabel="Selecione" itemDisabled="true" />
											<f:selectItems value="#{diplomaBacking.listaSituacao}"
												var="s" itemLabel="#{s.descricao}" itemValue="#{s.id}" />
										</p:selectOneMenu>
										<p:commandButton value="Adicionar" icon="ui-icon-plus"
											actionListener="#{diplomaBacking.adicionarSituacao}"
											ajax="false" update="tblSituacao" />
									</h:panelGrid>
									<br />
									<p:dataTable value="#{diplomaBacking.listaSituacaoDipAluno}"
										var="ds" id="tblSituacao">
										<p:column headerText="Data">
											<h:outputText value="#{ds.data}">
												<f:convertDateTime pattern="dd/MM/yyyy" />
											</h:outputText>
										</p:column>
										<p:column headerText="Situação">
											<h:outputText value="#{ds.situacao.descricao}" />
										</p:column>
										<p:column headerText="Local">
											<h:outputText value="#{ds.situacao.local}" />
										</p:column>
										<p:column headerText="Usuário">
											<h:outputText value="#{ds.usuario.nome}" />
										</p:column>
									</p:dataTable>
									<br />

								</p:tab>

								<p:tab title="Dados do Diploma">
									<h:panelGrid columns="4">
										<h:outputText value="Nº Processo:" />
										<p:inputText size="30" id="txtNprocesso"
											value="#{diplomaBacking.diploSalvar.numRegistro}" />
										<h:outputText value="Data Reg.:" />
										<p:calendar size="20" id="txtDataRegistro"
											value="#{diplomaBacking.diploSalvar.dataRegistro}" />
										<h:outputText value="Nº Diploma:" />
										<p:inputText size="30" id="txtNumDiploma"
											value="#{diplomaBacking.diploSalvar.numDiploma}" />
										<h:outputText value="Livro:" />
										<p:inputText size="20" id="txtLivro"
											value="#{diplomaBacking.diploSalvar.livro}" />
										<h:outputText value="Folha:" />
										<p:inputText size="30" id="txtFolha"
											value="#{diplomaBacking.diploSalvar.folha}" />
									</h:panelGrid>
								</p:tab>

							</p:tabView>

							<p:separator />
							<br />
							<div align="center">
								<h:panelGrid columns="2">
									<p:commandButton value="Gravar"
										actionListener="#{diplomaBacking.salvar}" ajax="false"
										update="growl" />
									<p:commandButton value="Limpar" />
								</h:panelGrid>
							</div>
						</p:tab>
					</p:tabView>
				</p:panel>
			</h:form>

			<h:form>
				<p:dialog widgetVar="dlgPesquisaDepto" header="Departamentos"
					footer="SAIES - Sistema de Avaliação Institucional do Ensino Superior"
					height="300" width="500" showEffect="clip" hideEffect="clip">

				</p:dialog>
			</h:form>

		</ui:define>
	</ui:decorate>
</h:body>
</html>